package com.maidada.mddaichat.common;

import lombok.Getter;

/**
 * @author: wulinxuan
 * @date: 2024/12/17 23:10
 */
@Getter
public enum ErrorCode {

    /**
     * 异常码
     */
    SUCCESS(0, "ok"),
    PARAMS_ERROR(40000, "请求参数错误"),
    NOT_LOGIN_ERROR(40100, "未登录"),
    NO_AUTH_ERROR(40101, "无权限"),
    TOKEN_INVALID(40102, "token已失效"),
    FORBIDDEN_ERROR(40300, "禁止访问"),
    NOT_FOUND_ERROR(40400, "请求数据不存在"),
    DATA_NOT_FOUND_ERROR(40401, "数据不存在"),
    TIMEOUT_ERROR(40800, "请求超时"),
    DATA_ALREADY_EXISTS_ERROR(40900, "数据已存在"),
    CONFLICT_ERROR(40901, "请求冲突"),
    SYSTEM_ERROR(50000, "系统内部异常"),
    OPERATION_ERROR(50001, "操作失败"),
    VALIDATION_ERROR(42200, "请求数据校验失败");


    private final int code;

    private final String msg;

    ErrorCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
